<template>
  <el-dialog
    :title="dTitle"
    :visible.sync="visible"
    width="50%"
    :before-close="closeDialog"
  >
    <el-form
      :model="form"
      :inline="true"
      ref="form"
      class="form-style"
      label-width="100px"
    >
      <el-form-item prop="atName">
        <el-input v-model="form.atName" placeholder="团长姓名"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button>搜索</el-button>
      </el-form-item>
    </el-form>
    <div class="table-style">
        <el-table :data="tabledata" border>
            <el-table-column label="团长姓名"></el-table-column>
            <el-table-column label="手机号"></el-table-column>
            <el-table-column label="所属客服"></el-table-column>
            <el-table-column label="操作"></el-table-column>
        </el-table>
        <botpage
        class="botpage-style"
        :currentPage="currentPage"
        :pageSize="pageSize"
        :total="total"
        @handleCurrentChange="currentChange"
        @pageSizeChange="pageSizeChange"
      />
    </div>
  </el-dialog>
</template>

<script>
import { AddSupplier, LoadSuppliers } from "@/request/api";
import Botpage from "@/components/botpage/Botpage"
export default {
  props: {
    dTitle: {
      type: String,
      default: "",
    },
    visible: {
      type: Boolean,
      default: false,
    },
    formData: {
      type: Object,
      default: {},
    },
  },
  methods: {
    closeDialog(reload) {
      this.$emit("closeDialog", reload);
    },
    currentChange(val) {
      this.currentPage = val;
    },
    pageSizeChange(val) {
      this.pageSize = val;
    },
  },
  watch: {
    formData(newVal, oldVal) {
      if (newVal) {
        this.form = { ...newVal };
      }
    },
  },
  mounted() {
    this.$nextTick(function () {
      this.form = this.formData;
    });
  },
  data() {
    return {
        currentPage:1,
        pageSize:10,
        total:1,
      tabledata:[],
      form: {},
      options: [],
    };
  },
  components: {
      Botpage
  }
};
</script>

<style lang="less" scoped>
</style>